package com.sc;

import java.util.Date;

/**
 * Created by Shen Chao on 2018-06-04.
 * 代码执行adb点击屏幕点
 */
public class TouchScreen {

//    public static void main(String[] args) {
//        while (true) {
//            //刷礼物
//            Gift.getGift();
//        }
//    }

    // 两次点击按钮之间的点击间隔不能少于1000毫秒
    private static final int MIN_CLICK_DELAY_TIME = 1000;
    private static long lastClickTime;

    //返回true则表示点击太快  false表示地正常
    public static boolean isFastClick() {
        long curClickTime = System.currentTimeMillis();
        if ((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME) {
            lastClickTime = curClickTime;
            return false;
        }
        return true;
    }

    public static void main(String[] args) {
//        boolean b = isFastClick();
//        System.out.println(lastClickTime);
//        System.out.println(b);
        long time1 = new Date().getTime();
        long time2 = System.currentTimeMillis();
        System.out.println(time1);
        System.out.println(time2);
        System.out.println(time1 == time2);
    }
}
